cmake_minimum_required(VERSION 3.20.2)
project(cJSONTest VERSION 1.0)

set(CMAKE_INSTALL_BINDIR "${CMAKE_CURRENT_SOURCE_DIR}/build/bin")

include(ProcessorCount)
ProcessorCount(CPU_CORE_COUNT)
math(EXPR PROCESSOR_COUNT "${CPU_CORE_COUNT} - 2")
message("[INFO]PROCESSOR_COUNT: ${PROCESSOR_COUNT}")

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/1234)
file(GLOB SOURCE_FILES
	"*.c"
    "*.cpp"
)

# 编译动态链接库
# add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})

# 编译静态链接库
# add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})

add_executable(${PROJECT_NAME} ${SOURCE_FILES})
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
